<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		//最大值
		var arr = [2, 8, 21, 74, 28,99];
		
		var result = arr[0];
		for (var i = 1; i < arr.length; i++) {
		    result =  Math.max(result, arr[i]);
		}
		console.log(result);
		document.write(arr);
		</script>
	</body>
</html>
